using System.Collections;
using System.Collections.Generic;
using UI;
using UnityEngine;

public class DisableUI : MonoBehaviour
{
    public bool isDisable;
    public GameObject[] UI;
    public GameObject[] cards;
    public CardListController cardListBox;

    public void DisableUIs()
    {
        Debug.Log("关闭UI");
        if (!isDisable)
        {
            foreach (var item in UI)
            {
                item.SetActive(false);
            }

            foreach (var card in cardListBox.cardList)
            {
                card.gameObject.SetActive(false);
            }

            isDisable = true;
        }
        else
        {
            foreach (var item in UI)
            {
                item.SetActive(true);
            }
            foreach (var card in cardListBox.cardList)
            {
                card.gameObject.SetActive(true);
            }
            isDisable = false;
        }
    }
    
}
